import { FormInstance } from 'antd/es/form/Form'
// 共享用一个Form一定要 全都配置 onValuesChange
export const onValuesChange = (changedValues: any, trimKeys: string[], form: FormInstance) => {
  trimKeys.forEach((key) => {
    if (changedValues[key]) {
      const trimmedKey = changedValues[key].trim()
      form.setFieldsValue({
        [key]: trimmedKey,
      })
    }
  })
}
